package com.shb.jutils.commons;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * 读取资源文件
 * @author shb
 *
 */
public class PropertyFileUtil {

	public static Properties readProperty (String filePath){
		Properties p = new Properties();
		InputStream in = null;
		try{
			in = PropertyFileUtil.class.getResourceAsStream(filePath);
			p.load(in);
		}catch(IOException e){
			throw new RuntimeException(e);
		}finally {
			if(in != null){
				try {
					in.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}
		return p;
	}
}
